As will be described in detail below, the calculation of elementary mathematical functions, such as a two argument arc tangent (tan−1 (A/B)), in a computer system may best be efficiently performed using a remainder from a floating-point quotient and lookup tables. Known prior art techniques do not typically create such lookup tables to efficiently return results of a specified accuracy. The present invention, however, is directed at using a floating-point remainder (Rfp), derived from a floating-point quotient (Qfp), to create lookup tables based on an approximate remainder that “exactly” represents the underlying arithmetic value within the specified accuracy. The created lookup tables are thus efficiently tailored to the intended use, with no more and no less accuracy than will be needed in the particular application. Such efficiency can result in both faster calculations and more compact lookup tables.
The remainder in a division process is an important entity in many floating-point calculations. In fact, the remainder calculation is considered so basic an operation that IEEE Standard 754 mandates such an operation be supported. IEEE Std. 754-1985, reaffirmed 1990, Standard for Binary Floating-Point Arithmetic. Unfortunately, most hardware implementations of the IEEE remainder are slow, with resources often dedicated to other operations such as basic floating-point add, subtract, and multiply, or others such as single-instruction-multiple-data operations. Moreover, in some common situations, the definition of the IEEE remainder is not “naturally” applicable, as the IEEE quotient is an integer quotient, whereas many applications require the remainder with a floating-point quotient.